home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / Complex.3T < prev    next >
Text File  |  1992-06-26  |  10KB  |  275 lines

  1. .TH COMPLEX
  2. .SH NAME
  3. Complex  Complex number class
  4. .SH SYNOPSIS
  5. #include <cool/Complex.h>
  6. .SH DESCRIPTION
  7. The 
  8.  Complex 
  9. class is a complex number class with basic arithmetic support, 
  10. conversion to and from built-in types, and simple arithmetic exception 
  11. handling. A 
  12.  Complex 
  13. object has the same precision and range of values as the 
  14. system-defined type 
  15.  double . 
  16. Implicit conversion to the system-defined types 
  17.  short , 
  18.  int , 
  19.  long , 
  20.  float , 
  21. and 
  22.  double 
  23. is supported by overloaded operator member 
  24. functions. However, despite the implicit conversions and judicious use of 
  25. inline member functions, arithmetic operations on 
  26.  Complex 
  27. objects are slower than the built-in types.
  28. .PP
  29. The 
  30.  Complex 
  31. class implements common arithmetic exception handling and provides 
  32. application support for detecting negative infinity, positive infinity, 
  33. overflow, and underflow that may result from an operation. If one of these 
  34. conditions is detected or an attempt to convert from a 
  35.  Complex 
  36. with no value to 
  37. a built-in type is made, an exception is raised. The programmer can provide an 
  38. exception handler at runtime to take care of this problem. If no such handler 
  39. is available, an error message is printed and program execution ends. See 
  40. Section 13 for more information on the cool exception handling mechanism.
  41. .SH Base Classes
  42. None
  43. .SH Friend Classes
  44. None
  45. .SH Constructors
  46. .TP
  47.  inline Complex ();
  48. Creates a new complex number object initialized to floating point zero.
  49. .TP
  50. \f3inline Complex (double \f2real\f3, double \f2imaginary \f1= 0.0\f3);\f1
  51. Creates a new complex number object whose 
  52.  real 
  53. part is set to real and whose imaginary part is initialized to the value of 
  54.  imaginary .
  55. .TP
  56. \f3inline Complex (const Complex& \f2c\f3);\f1
  57. Creates a new complex number object whose real and imaginary parts are 
  58. initialized to the values of those of another complex number 
  59.  c .
  60. .SH Member Functions
  61. .TP
  62.  inline Complex conjugate () const;
  63. Calculates the conjugate of a complex number and returns a new object whose 
  64. value is the negated imaginary value of the object. If the operation results in 
  65. an arithmetic error of some type, the appropriate exception is raised.
  66. .TP
  67. \f3inline Complex cos (Complex& \f2c\f3) const;\f1
  68. Calculates the cosine of a complex number \f2c\f1. A new complex object is returned 
  69. as the result. If the operation results in an arithmetic error of some type, 
  70. the appropriate exception is raised.
  71. .TP
  72. \f3inline Complex cosh (Complex& \f2c\f3) const;\f1
  73. Calculates the hyperbolic cosine of a complex number \f2c\f1. A new complex object is 
  74. returned as the result. If the operation results in an arithmetic error of some 
  75. type, the appropriate exception is raised.
  76. .TP
  77.  operator double ();
  78. Overloaded operator to provide implicit conversion between complex objects and 
  79. the built-in 
  80.  double 
  81. type when appropriate.
  82.  
  83. .TP
  84.  operator float ();
  85. Overloaded operator to provide implicit conversion between complex objects and 
  86. the built-in 
  87.  float 
  88. type when appropriate.
  89. .TP
  90.  inline double imaginary () const;
  91. Returns the imaginary part of the complex number.
  92. .TP
  93.  inline Complex invert () const;
  94. Returns the reciprocal of a complex number. If the operation results in an 
  95. arithmetic error of some type, the appropriate exception is raised.
  96. .TP
  97.  operator int ();
  98. Overloaded operator to provide implicit conversion between complex objects and 
  99. the built-in 
  100.  int 
  101. type when appropriate.
  102. .TP
  103.  operator long ();
  104. Overloaded operator to provide implicit conversion between complex objects and 
  105. the built-in 
  106.  long 
  107. type when appropriate.
  108. .TP
  109.  Complex operator\- ();
  110. Overloads the unary minus operator for the 
  111.  Complex 
  112. class and returns a new 
  113. object whose value is the negated real value of the object. If the operation 
  114. results in an arithmetic error of some type, the appropriate exception is 
  115. raised.
  116. .TP
  117. \f3Complex& operator= (const Complex& \f2c\f3);\f1
  118. Overloads the assignment operator for the 
  119.  Complex 
  120. class and assigns one complex 
  121. number to have the value of another. A reference to the updated object is 
  122. returned.
  123. .TP
  124. \f3inline void operator+= (const Complex& \f2c\f3);\f1
  125. Overloads the addition-with-assignment operator for the 
  126.  Complex 
  127. class. If the operation results in an arithmetic error of some type, the appropriate exception is raised.
  128. .TP
  129. \f3inline void operator\-= (const Complex& \f2c\f3);\f1
  130. Overloads the subtraction-with-assignment operator for the 
  131.  Complex 
  132. class. If 
  133. the operation results in an arithmetic error of some type, the appropriate 
  134. exception is raised.
  135. .TP
  136. \f3inline void operator*= (const Complex& \f2c\f3);\f1
  137. Overloads the multiplication-with-assignment operator for the 
  138.  Complex 
  139. class. If 
  140. the operation results in an arithmetic error of some type, the appropriate 
  141. exception is raised.
  142. .TP
  143. \f3inline void operator/= (const Complex& \f2c\f3);\f1
  144. Overloads the division-with-assignment operator for the 
  145.  Complex 
  146. class. If the 
  147. operation results in an arithmetic error of some type, the appropriate 
  148. exception is raised.
  149. .TP
  150.  inline Complex& operator++ ();\f1
  151. Overloads the increment operator to provide an increment capability for the 
  152.  Complex 
  153. class. If the operation results in an arithmetic error of some type, 
  154. the appropriate exception is raised.  A reference to the updated complex object 
  155. is returned.
  156. .TP
  157.  inline Complex& operator\-\|\- ();\f1
  158. Overloads the decrement operator to provide a decrement capability for the 
  159.  Complex 
  160. class. If the operation results in an arithmetic error of some type, 
  161. the appropriate exception is raised.  A reference to the updated complex object 
  162. is returned.
  163. .TP
  164.  inline Boolean operator! () const;
  165. Overloads the logical NOT operator for the 
  166.  Complex 
  167. class and returns 
  168.  
  169.  TRUE 
  170. if the complex number has a zero value; otherwise, this function returns 
  171.  
  172.  FALSE .
  173. .TP
  174. \f3inline Boolean operator== (const Complex& \f2c\f3) const;\f1
  175. Overloads the equality operator for the 
  176.  Complex 
  177. class. This function returns
  178.  
  179.  TRUE 
  180. if the complex numbers have the same value; otherwise, this function 
  181. returns 
  182.  
  183.  FALSE .
  184. .TP
  185. \f3inline Boolean operator!= (const Complex& \f2c\f3) const;\f1
  186. Overloads the inequality operator for the 
  187.  Complex 
  188. class. This function returns 
  189.  
  190.  TRUE
  191.  if the complex numbers have different values; otherwise, this function 
  192. returns 
  193.  
  194.  FALSE .
  195. .TP
  196.  inline double real () const;
  197. Returns the real part of the complex number.
  198. .TP
  199.  operator short ();
  200. Overloaded operator to provide implicit conversion between complex objects and 
  201. the built-in 
  202.  short 
  203. type when appropriate.
  204. .TP
  205. \f3inline Complex sin (Complex& \f2c\f3) const;\f1
  206. Calculates the sine of a complex number \f2c\f1. A new complex object is returned as the result. If the operation results in an arithmetic error of some type, the appropriate exception is raised.
  207. .TP
  208. \f3inline Complex sinh (Complex& \f2c\f1) const;\f1
  209. Calculates the hyperbolic sine of a complex number \f2c\f1. A new complex object is 
  210. returned as the result. If the operation results in an arithmetic error of some 
  211. type, the appropriate exception is raised.
  212. .TP
  213.  inline N_State status () const;
  214. Returns the numerical exception state of the complex object.
  215. .TP
  216. \f3inline Complex tan (Complex& \f2c\f3) const;\f1
  217. Calculates the tangent of a complex number \f2c\f1. A new complex object is returned 
  218. as the result. If the operation results in an arithmetic error of some type, 
  219. the appropriate exception is raised.
  220. .TP
  221. \f3inline Complex tanh (Complex& \f2c\f1) const;\f3
  222. Calculates the hyperbolic tangent of a complex number \f2c\f1. A new complex object 
  223. is returned as the result. If the operation results in an arithmetic error of 
  224. some type, the appropriate exception is raised.
  225. .SH Friend Functions
  226. .TP
  227. \f3inline friend Complex operator+ (const Complex& \f2c1\f3, const Complex& \f2c2\f3);\f1
  228. Overloads the addition operator to provide addition for the 
  229.  Complex 
  230. class. A 
  231. new complex object is returned as the result. If the operation results in an 
  232. arithmetic error of some type, the appropriate exception is raised.
  233. .TP
  234. \f3inline friend Complex operator\- (const Complex& \f2c1\f3, const Complex& \f2c2\f3);\f1
  235. Overloads the subtraction operator for the 
  236.  Complex 
  237. class. A new complex object 
  238. is returned as the result. If the operation results in an arithmetic error of 
  239. some type, the appropriate exception is raised.
  240. .TP
  241. \f3inline friend Complex operator* (const Complex& \f2c1\f3, const Complex& \f2c2\f3);\f1
  242. Overloads the multiplication operator for the 
  243.  Complex 
  244. class. A new complex 
  245. object is returned as the result. If the operation results in an arithmetic 
  246. error of some type, the appropriate exception is raised.
  247. .TP
  248. \f3friend Complex operator/ (const Complex& \f2c1\f3, const Complex& \f2c2\f3);\f1
  249. Overloads the division operator to provide division for the 
  250.  Complex 
  251. class. A 
  252. new complex object is returned as the result. If the operation results in an 
  253. arithmetic error of some type, the appropriate exception is raised.
  254. .TP
  255. \f3inline friend ostream& operator<< (ostream& \f2os\f3, const Complex& \f2c\f3);\f1
  256. Overloads the output operator for a reference to a complex object to provide a 
  257. formatted output.
  258.  
  259. .TP
  260. \f3inline friend ostream& operator<< (ostream& \f2os\f3, const Complex* \f2c\f3);\f1
  261. Overloads the output operator for a pointer to a complex object to provide a 
  262. formatted output.
  263. .SH COPYRIGHT
  264.  
  265. Copyright (C) 1991 Texas Instruments Incorporated.
  266.  
  267. Permission is granted to any individual or institution to use, copy, modify,
  268. and distribute this software, provided that this complete copyright and
  269. permission notice is maintained, intact, in all copies and supporting
  270. documentation.
  271.  
  272. Texas Instruments Incorporated provides this software "as is" without
  273. express or implied warranty.
  274.  
  275.